class Api::V1::ValidationcodesController < ApplicationController
  def index
    head 200
  end

  def create
    email = params[:email]
    token = SecureRandom.random_number.to_s[2..7]
    validationcode = Validationcode.new email: email, code: token, kind: 1
    if validationcode.save
      render json: validationcode
    else
      render json: validationcode.errors, status: 400
    end
  end
end
